package cn.iocoder.yudao.module.erp.dal.mysql.payinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.payinfo.PayInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.payinfo.vo.*;

/**
 * 付款记录信息 Mapper
 *
 * @author mhc
 */
@Mapper
public interface PayInfoMapper extends BaseMapperX<PayInfoDO> {

    default PageResult<PayInfoDO> selectPage(PayInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayInfoDO>()
                .eqIfPresent(PayInfoDO::getCustomerId, reqVO.getCustomerId())
                .eqIfPresent(PayInfoDO::getType, reqVO.getType())
                .betweenIfPresent(PayInfoDO::getPayCount, reqVO.getPayCount())
                .betweenIfPresent(PayInfoDO::getPayDate, reqVO.getPayDate())
                .eqIfPresent(PayInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayInfoDO::getCreateTime));
    }

}